﻿<Window x:Class="AdventureWorks.Client.WPF.Errors"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:l="clr-namespace:AdventureWorks.Client.WPF"
    Title="Errors" Height="300" Width="400">
    <Window.Resources>
        <l:SeverityToBrushConverter x:Key="SeverityConverter" Error="DarkRed" Warning="DarkOrange" Critical="Red"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ListBox Name="lstErrors" Margin="10" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Message}" Foreground="{Binding Path=Severity, Converter={StaticResource SeverityConverter}}" TextWrapping="Wrap"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Button Grid.Row="1" Margin="0,0,0,10" HorizontalAlignment="Center" MinWidth="75" Name="btnClose" Click="btnClose_Click">Close</Button>
    </Grid>
</Window>
